/*
 * Copyright 2011 Angel Sanadinov
 *
 * This file is part of VBox WMI.
 *
 * VBox WMI is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * VBox WMI is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with VBox WMI.  If not, see <http://www.gnu.org/licenses/>.
 */

package Beans.Responses.DataRetrievalComponents;

import com.sun.xml.ws.commons.virtualbox_3_2.IGuestOSType;

/**
 * This class represents a supported Guest OS Type on a VirtualBox server.
 *
 * @author Angel Sanadinov
 */
public class GuestOSTypeDataComponent extends DataRetrievalComponent
{
    private String familyId;            //the id of the OS type family
    private String familyDescription;   //the family description of the OS type
    private String osTypeId;            //the id of the OS type
    private String osTypeDescription;   //the description of the OS type

    /**
     * Constructs the guest OS type data component using the specified data.
     *
     * @param guestOSType the OS type provided by the VirtualBox server
     */
    public GuestOSTypeDataComponent(IGuestOSType guestOSType)
    {
        this.familyId = guestOSType.getFamilyId();
        this.familyDescription = guestOSType.getFamilyDescription();
        this.osTypeId = guestOSType.getId();
        this.osTypeDescription = guestOSType.getDescription();
    }

    /**
     * Retrieves the guest OS type family id. <br><br>
     *
     * E.g.: Windows, Linux, BSD, etc.
     *
     * @return the guest OS type family id
     */
    public String getFamilyId()
    {
        return familyId;
    }

    /**
     * Retrieves the guest OS type family description. <br><br>
     *
     * E.g.: Microsoft Windows, Linux, Mac OS X, etc.
     *
     * @return the guest OS type family description
     */
    public String getFamilyDescription()
    {
        return familyDescription;
    }

    /**
     * Retrieves the guest OS type id. <br><br>
     *
     * E.g.: Windows31, Linux26, OS2Warp3, etc.
     *
     * @return the guest OS type id
     */
    public String getOsTypeId()
    {
        return osTypeId;
    }

    /**
     * Retrieves the guest OS type description. <br><br>
     *
     * E.g.: Windows 3.1, Linux 2.6, OS/2 Warp 3, etc.
     *
     * @return the guest OS type description
     */
    public String getOsTypeDescription()
    {
        return osTypeDescription;
    }

    @Override
    public boolean isValid()
    {
        if(familyId != null && familyDescription != null
                && osTypeId != null && osTypeDescription != null)
            return true;
        else
            return false;
    }
}
